﻿Public Class RadicionalesProforma

    Public Shared Function SeleccionarTodo(ByVal DisplaySelect As Boolean) As List(Of EadicionalesProforma)
        Dim adicionales As List(Of EadicionalesProforma) = Nothing

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                adicionales = DnivelInteres.SeleccionarTodo
                If DisplaySelect Then adicionales.Insert(0, New EadicionalesProforma("00", "-- SELECIONAR --"))
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return adicionales
    End Function
    Public Shared Function Añadir(ByVal pnivel As EadicionalesProforma) As Boolean
        Dim resultado As Boolean = False

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                resultado = DnivelInteres.Añadir(pnivel)
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return resultado
    End Function
    Public Shared Function Editar(ByVal pnivel As EadicionalesProforma) As Boolean
        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                DnivelInteres.Editar(pnivel)
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using
    End Function
    Public Shared Function Eliminar(ByVal pnivel As EadicionalesProforma) As Boolean
        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                DnivelInteres.Eliminar(pnivel)
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using
    End Function

End Class
